#include "Shm.hpp"

int main()
{
    printf("hellowrold");
    printf("hellowrold");
    printf("hellowrold");
    printf("hellowrold");
    printf("hellowrold");
    printf("hellowrold");

    SharedMemory shm;
    shm.Creat();
    // sleep(5);

    shm.Attach();
    // sleep(5);

   

    sleep(3);

    // 使用
    while (true)
    {
        char c;
        shm.Popchar(&c);

        printf("server get char: %c\n", c);

        sleep(1);
    }

    shm.Detach();
    // sleep(5);

    
    // sleep(5);

    // for (size_t i = 0; i < count; i++)
    // {
    //     /* code */
    // }

    printf("hellowrold");
    printf("hellowrold");
    printf("hellowrold");
    printf("hellowrold");
    printf("hellowrold");
    printf("hellowrold");

    return 0;
}